#include "base.h"

#define OUTPUT_FORMAT "mjpeg"
#define OUTPUT_FILE_NAME "output"
#define OUTPUT_FILE_TYPE_VIDEO ".mkv"
#define OUTPUT_FILE_TYPE_IMG "jpeg"

/*
    基础设置
*/
struct Setting {
    string DevFilePath; // 设备
    string Resolution ; // 分辨率
};

class Camera{
    public:
    Camera(const Setting& setting){
        this-> _Setting = setting;

        // av_dict_set(
        //     &this->options, "video_size", "640x480", 0
        // );
    }
    
        int init(bool useDshow);
        void release();

        int start_REC();
        int stop_REC();
        int status_REC(string DevFilePath);


        int cheese();

        void version();

    private:
        Setting _Setting;
        // AVDictionary *options;
        AVFormatContext *pFmtCtx;

        AVCodecContext  *pCodecCtx;
        // AVInputFormat   *pIptFmt;
        // AVCodec         *pCodec;

};